import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
	state: {
		
		templeData:null,

		user: null,
		weixinMes: {
			appid: '',
			secret: '',
			mch_id: '',
			key: ''
		},
		tid: 1, //我们的商户id


	},
	mutations: {

		setWeixinMes(state, payload) {
			state.weixinMes = payload;
		},
		setTid(state, payload) {
			state.tid = payload;
		},
		setUser(state, payload) {
			state.user = payload;
		},
		setTempleData(state, payload) {
			state.templeData = payload;
		}

	},

	getters: {
		// ...
		getWeixinMes: (state) => {
			return state.weixinMes;
		},
		getTid: (state) => {
			return state.tid;
		},
		getUser: (state) => {
			return state.user;
		},
		getTempleData: (state) => {
			return state.templeData;
		}


	},
	actions: {

	}
})
